/+

d language mysql driver (bindings)
https://github.com/tbolsh/mysql-wrapping-for-D-programming-language-v2

Eclipse DDT - project properties D compile options (static linking)

-m64 -d -L/usr/lib/libmysqlclient.a 
-od$DEEBUILDER.OUTPUTPATH
-of$DEEBUILDER.OUTPUTEXE
$DEEBUILDER.SRCLIBS.-I
$DEEBUILDER.SRCFOLDERS.-I
$DEEBUILDER.SRCMODULES 

+/

import mysql;
import mysql_wrapper;
import std.stdio;
import std.c.process;


//extern(C) void* mysql_init(void*);

void main(string[] args){
	if( args.length==1 ){
		args = ["","localhost","root","sql","4sh"];
	}
	string host = args[1];
	string user = args[2];
	string pwd  = args[3];
	string dbname = args[4];
	
	MYSQL *mysql;
	MYSQL_RES *result;
	string[string] hash;
	string[] array;

	mysql = mysql_init(null);
	if (!mysql_connect_d(mysql,host,user,pwd,dbname,0,null,0)) {
		writefln("Verbindung fehlgeschlagen");
		return ;
	}
writeln("connected");
	int i = 0;
	//while(true) {
		mysql_query_d(mysql, "select * from tblDataCenter ");
		result = mysql_use_result(mysql);
		//while (( array = mysql_fetch_array(result)) != null) {
		while (( hash = mysql_fetch_assoc(result)) != null) {
			foreach ( string key; hash.keys.sort ) {
				writefln("%s = %s",key,hash[key]);
			}
		writeln("=================================================================");
		}
		writeln("=================================================================");
	//}

	mysql_close(mysql);
}